﻿CREATE TABLE [dbo].[SIWaitInvestigatePaper]
(
	[Id] INT NOT NULL PRIMARY KEY IDENTITY, 
	[Status] INT NOT NULL DEFAULT 0, 
    [PatientId] NVARCHAR(50) NULL , 
    [Name] NVARCHAR(50) NULL, 
    [CardNo] NVARCHAR(50) NULL, 
	[CardType] INT,
    [ClinicNo] NVARCHAR(50) NULL, 
    [Type] INT NULL, 
    [CreateTime] DATETIME NULL, 
    [SubmitTime] DATETIME NULL, 
    [SubmitCount] INT NULL DEFAULT 0, 
    [SubmitOpenId] NVARCHAR(50) NULL, 
	[NeedSendTime] DATETIME NULL,
    [IsSended] INT NULL, 
    [SendTime] DATETIME NULL
)

GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'病人ID',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'PatientId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'病人姓名',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'Name'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'诊疗号号',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'CardNo'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'诊断号',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'ClinicNo'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'类型: 0-挂号',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'Type'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'生成时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'CreateTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'提交时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'SubmitTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'提交次数',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'SubmitCount'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'状态：0x1-完成，0x2-删除，0x4-锁定',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'Status'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'等待评价的诊疗记录',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = NULL,
    @level2name = NULL
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'诊疗号类型：0诊疗卡 1健康卡 2市民卡',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'CardType'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'提交人的微信用户OpenId',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'SubmitOpenId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'是否已发送',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'IsSended'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'发送时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'SendTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'需要发送的时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'SIWaitInvestigatePaper',
    @level2type = N'COLUMN',
    @level2name = N'NeedSendTime'